# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=perl-net-dhcp
_pkgname=Net-DHCP
pkgver=0.7_007
pkgrel=13
epoch=1
pkgdesc='Object methods to create a DHCP packet.'
arch=('any')
url='http://search.cpan.org/~djzort/Net-DHCP-0.684/lib/Net/DHCP.pm'
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl-module-build')
source=("http://search.cpan.org/CPAN/authors/id/D/DJ/DJZORT/$_pkgname-$pkgver.tar.gz")
sha512sums=('87aa497a910a9d31ac5a0a783ed79b1c941074a640dea808d3fcd8af436f10a7ef011c754e806313f9ca8e20e91ab76307eb1ba980fd261d4ba6d6925ecf726f')

prepare() {
  cd "$_pkgname-$pkgver"

  export PERL_MM_USE_DEFAULT=1 PERL5LIB="" \
    PERL_AUTOINSTALL=--skipdeps \
    PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \
    PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
    MODULEBUILDRC=/dev/null
}

build() {
  cd "$_pkgname-$pkgver"

  /usr/bin/perl Build.PL

  ./Build installdeps
  ./Build
}

package() {
  cd "$_pkgname-$pkgver"

  ./Build install

  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}

